import defaultImg from '@/assets/images/200.png'
import { vueuse } from '@/compositions'

export default {
  install (Vue) {
    Vue.directive('defaultImg', {
      mounted (el, text) {
        function error () {
          el.onerror = () => {
            return (el.src = defaultImg)
          }
          el.src = text.value
        }
        vueuse(el, error)
      }
    })
  }
}
